
from rest_framework import serializers
from goods_info.models import AttachmentModel

class AttachmentSerializer(serializers.ModelSerializer):
    """
        附件（图片等）的序列化器，和反序列化
    """
    type_display = serializers.CharField(source='get_a_type_display', read_only=True)

    class Meta:
        model = AttachmentModel
        fields = '__all__'

